//
//  CellOfCellOfIconListCommendScenicSpotView.m
//  FreeTravel
//
//  Created by 徐康 on 16/9/3.
//  Copyright © 2016年 KX. All rights reserved.
#import "Masonry.h"
#import "UIImageView+WebCache.h"
#import "CellOfCellOfIconListCommendScenicSpotView.h"
@interface CellOfCellOfIconListCommendScenicSpotView ()
@property (nonatomic, strong) UILabel *labelOfIcon;
@property (nonatomic, strong) UIImageView *imageviewOfIcon_pic;
@end
@implementation CellOfCellOfIconListCommendScenicSpotView
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.imageviewOfIcon_pic = [[UIImageView alloc]init];
        self.labelOfIcon = [[UILabel alloc]init];
        [self.contentView addSubview:self.imageviewOfIcon_pic];
        [self.contentView addSubview:self.labelOfIcon];
    }
    return self;
}
- (void)layoutSubviews{
    [super layoutSubviews];
    [self.imageviewOfIcon_pic mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.equalTo(self.contentView);
        make.height.mas_offset(40);
    }];
    [self.labelOfIcon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.left.right.equalTo(self.contentView);
        make.height.mas_offset(20);
    }];
    self.labelOfIcon.font = [UIFont systemFontOfSize:12];
    self.labelOfIcon.textAlignment = NSTextAlignmentCenter;
}
- (void)setModel:(ModelOfIconListCommendScenicSpotView *)model{
    _model = model;
    [self.imageviewOfIcon_pic sd_setImageWithURL:[NSURL URLWithString:model.icon_pic]];
    self.labelOfIcon.text = model.icon;
    
}
@end
